#include <vector>

using namespace std;
class Solution {
public:
    vector<int> findDuplicates(vector<int>& nums) {		
		vector<int> ret;
		for(int i=0;i<nums.size();++i)
		{
			int index = (nums[i]>0?nums[i]:-nums[i]) - 1;
			if (nums[index] < 0)
				ret.push_back(index+1);
			nums[index] = -nums[index];
		}
		return ret;
    }
};
int main()
{
	
}